COMPTOOLS: A Compiler Generator for C and Java

نویسنده

  • Gilbert Babin
چکیده

There currently exists a large number of tools to generate parsers and lexical analyzers. However, only a small number of such tools provide a complete solution for the construction of the parser and of the lexical analyzer. Furthermore, to our knowledge, none of these tools propose a syntax diagram generator to document the grammars and lexicon of the newly defined languages. We propose the COMPTOOLS suite which offers a complete set of tools to develop and document parsers and lexical analyzers. Many features of the COMPTOOLS suite make it interesting: • it can be used for systems developed either in C or in Java, • the parser generator checks LL(1) conditions and generates extra code when ambiguous grammars are detected, enabling the developer to decide how to manage ambiguity, • the lexical analyzer generator combines multiple approaches to simplify the resulting lexical analyzer, • it can generate syntax diagrams for the lexicon and the grammar in EPSF format. The paper describes theses features and shows how it may be used to develop a new grammar. Résumé Un grand nombre de générateurs d’analyseur syntaxique et lexical sont présentement disponibles. Cependant, de ce nombre, peu d’outils offrent un éventail complet de solutions pour accomplir cette tâche. De plus, à notre connaissance, aucun de ces outils ne propose un générateur de diagramme syntaxique. Nous proposons ici la suite logicielle COMPTOOLS qui offre un tel éventail de solutions. Cette suite logicielle a plusieurs caractéristiques intéressantes : – elle permet la génération d’analyseurs en C ou en Java; – les conditions LL(1) sont vérifiée par le générateur d’analyseur lexical. Lorsque celle-ci ne sont pas vérifiée, l’analyseur généré permet au développeur de décider comment l’ambiguité peut être résolue; – le générateur d’analyseur lexical offrent plusieurs alternatives permettant de simplifier l’analyseur généré; – il offre la possibilité de générer des diagrammes syntaxiques en format EPS. Cette article présente les caractéristiques de COMPTOOLS. On y illustre aussi son utilisation. Copyright c © 2004. HEC Montréal. 3 COMPTOOLS: A Compiler Generator for C and Java Gilbert Babin

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

An Efficient XML Parser Generator Using Compiler Compiler Technique

This paper describes design issues and experiment results of an efficient XML parser generator, Xsong. A traditional compiler construction technique is applied to Xsong so that it realizes both expressiveness and efficiency for parsing XML documents. To compare with the performance of DOM based programs, SAX based programs and a program generated by Xsong, experiments were designed. The experim...

متن کامل

LL ( 1 ) Conflict Resolution in a Recursive Descent Compiler Generator 1

Recursive descent parsing is restricted to languages whose grammars are LL(1), i.e., which can be parsed top-down with a single lookahead symbol. Unfortunately, many languages such as Java, C++, or C# are not LL(1). Therefore recursive descent parsing cannot be used or the parser has to make its decisions based on semantic information or a multi-symbol lookahead. In this paper we suggest a syst...

متن کامل

LL(1) Conflict Resolution in a Recursive Descent Compiler Generator

Recursive descent parsing is restricted to languages whose grammars are LL(1), i.e., which can be parsed top-down with a single lookahead symbol. Unfortunately, many languages such as Java, C++, or C# are not LL(1). Therefore recursive descent parsing cannot be used or the parser has to make its decisions based on semantic information or a multi-symbol lookahead. In this paper we suggest a syst...

متن کامل

Web - Based Simulation of Systems Described by Partial Differential Equations

This paper describes how to take advantage of Internet services and object technology to solve 2D partial differential equations (PDEs) in a distributed manner. This is accomplished by means of a distributed object oriented continuous simulation language designed by our research group, called OOCSMP, and a Java (and C++) generating compiler for this language (called C-OOL). We also describe a g...

متن کامل

Program Annotation in XML: A Parse-Tree Based Approach

In this paper we describe a technique that can be used to annotate source code with syntactic tags in XML format. This is achieved by modifying the parser generator bison to emit these tags for an arbitrary LALR grammar. We also discuss an immediate application of this technique, a portable modification of the gcc compiler, that allows for XML output for C, Objective C, C++ and Java programs. W...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2004